package cn.kgc.spring05.servlet;

import cn.kgc.spring05.service.Impl.UserServiceImpl;
import cn.kgc.spring05.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

/**
 * @author: mosin
 * @version: v1.0  2022/12/1
 */
@Controller("userController")
public class UserServlet {

    @Autowired // 创建对象时 初始化 该属性
    private UserService userService;

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public boolean deleteById(Integer id){
        System.out.println("userServlet被调用");
        Boolean b = userService.deleteById(id);
        return  b;
    }

}
